package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.OrderProductMapper;
import com.qj.yantaishan.domain.OrderProduct;
import com.qj.yantaishan.service.IOrderProductService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 订单商品Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class OrderProductServiceImpl    extends ServiceImpl<OrderProductMapper, OrderProduct>  implements IOrderProductService
{
    @Autowired
    private OrderProductMapper orderProductMapper;

    /**
     * 查询订单商品
     * 
     * @param pigcmsId 订单商品主键
     * @return 订单商品
     */
    @Override
    public OrderProduct selectOrderProductByPigcmsId(Long pigcmsId)
    {
        return orderProductMapper.selectOrderProductByPigcmsId(pigcmsId);
    }

    /**
     * 查询订单商品列表
     * 
     * @param orderProduct 订单商品
     * @return 订单商品
     */
    @Override
    public List<OrderProduct> selectOrderProductList(OrderProduct orderProduct)
    {
        return orderProductMapper.selectOrderProductList(orderProduct);
    }

    /**
     * 新增订单商品
     * 
     * @param orderProduct 订单商品
     * @return 结果
     */
    @Override
    public int insertOrderProduct(OrderProduct orderProduct)
    {
        return orderProductMapper.insertOrderProduct(orderProduct);
    }

    /**
     * 修改订单商品
     * 
     * @param orderProduct 订单商品
     * @return 结果
     */
    @Override
    public int updateOrderProduct(OrderProduct orderProduct)
    {
        return orderProductMapper.updateOrderProduct(orderProduct);
    }

    /**
     * 批量删除订单商品
     * 
     * @param pigcmsIds 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteOrderProductByPigcmsIds(String pigcmsIds)
    {
        return orderProductMapper.deleteOrderProductByPigcmsIds(Convert.toStrArray(pigcmsIds));
    }

    /**
     * 删除订单商品信息
     * 
     * @param pigcmsId 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteOrderProductByPigcmsId(Long pigcmsId)
    {
        return orderProductMapper.deleteOrderProductByPigcmsId(pigcmsId);
    }
}
